Attribute VB_Name = "modMain"
'***************************************************************
' (c) Copyright 2000 Matthew J. Curland
'
' This file is from the CD-ROM accompanying the book:
' Advanced Visual Basic 6: Power Techniques for Everyday Programs
'   Author: Matthew Curland
'   Published by: Addison-Wesley, July 2000
'   ISBN: 0-201-70712-8
'   http://www.PowerVB.com
'***************************************************************
Option Explicit

Sub Main()
Dim pUnk As IUnknown
Dim pDerived As Derived
    InitVBoost
    Set pDerived = New Derived
    
    'This will call the original function
    MsgBox pDerived.OverrideMe
    
    'Force a QI to call the override. This is
    'only necessary for objects in the same
    'project. If New is called against an external
    'object, then VB always does a QI.
    Set pUnk = pDerived
    Set pDerived = pUnk
    MsgBox pDerived.OverrideMe
End Sub
